---
title: "Sale API"
method: POST
path: "/?sale (COPY)"
---

# Sale API

`POST /?sale (COPY)`

Direct sale with the card number. For AVS verification from the API, the fields sent should be based on the portal settings. If the setting is configured as “Address Only,” then only the address details should be sent in the address1 field. If the setting is configured as “ZIP Only,” then only the zip value should be sent in the zip property.

## Request body

- object
  - `appid` string, required — Merchant APP ID (Alphanumeric - Length of 32 chars)
  - `appkey` string, required — Merchant APP Key (Alphanumeric - Length of 32 chars)
  - `epi` string, required — EPI is an end point identifier, Identify the device on valor infrastructure, it's a 10 digit number starts with 2
  - `txn_type` string, required — sale or auth ('sale' - Amount of the purchase will be deducted from the cardholder's bank account and 'auth' - it will be held (authorized) for a certain period of time/days)
  - `token` string, required — Card token can be generated from <a href="https://valorapi.readme.io/reference/create-card-token" target="_blank"><b>Create Card Token</b></a>
  - `amount` number, double, required — Transaction amount - Maximum amount $99,999.99 (Ex: 0.1 to 99,999.99). A request should not be sent when the amount is 0. The amount must be greater than zero
  - `ecomm_channel` string
  - `cardholdername` string — Name of the cardholder - Alphabet (Max length of 25 chars)
  - `invoicenumber` string — Invoice number is a unique number assigned (Alphanumeric - Max length of 12 chars)
  - `orderdescription` string — Add the order description - Optional (Alphanumeric - Max length of 50 chars)
  - `surchargeAmount` number, double — Additional fee of surcharge amount - Currency $ (Eg: 10.00)
  - `surchargeIndicator` integer — The value '0' represents a transaction being ran on the traditional MID with no custom fee added, while '1' represents a transaction being ran on the cash discounting MID with the custom fee added
  - `phone` integer — Customer phone number- 10 digit Numeric (Ex: 5247896523)
  - `address1` string — Shipping address should be max 100 chars - Alphanumeric
  - `address` string — Billing address should be max 100 chars - Alphanumeric
  - `shipping_country` string, required — Shipping country should be mention default set us US
  - `billing_country` string — Billing country should be mention default set us US
  - `zip` string — Zip code should be 5 digits (Numeric - Ex: 10001, 90002)
  - `avs` string — Address verification service (zip, street address - Numeric length of one chars)
  - `email` string — Customer email id - Varchar (Ex: test@domain.com, Max length of 50 chars)
  - `tax_amount` string — Tax amount - Currency $ (Eg. 00.00)
  - `order_details` object
    - `product_line_items` object[] — Must be a non-empty array
      - `name` string, required — Maximum 50 characters. Should not be empty (Level 3 benefit)..
      - `code` string, required — Maximum 15 characters. Should not be empty (Level 3 benefit)..
      - `qty` integer, required — Should be a numeric value (Level 3 benefit)..
      - `unit_cost` integer, required — Should be a numeric value (Level 3 benefit).
      - `tax` integer — Should be a numeric value if provided (Level 3 benefit).
      - `commodity_code` string, required — The Commodity Code should allow up to 12 alphanumeric characters (Level 3 benefit).
      - `unit_of_measure` string, required — The Unit of Measure should allow up to 12 alphanumeric characters (Level 3 benefit).
      - `discount` number, double, required — Discount amount - Currency $ (Eg. 00.00) (Level 3 benefit).
      - `tax_rate` number, double, required — Tax amount - Currency $ (Eg. 00.00) (Level 3 benefit).
    - `discounts` object[] — Must be a non-empty array if present.
      - `name` string — Maximum 50 characters. Should not be empty.
      - `cost` number, double — Should be a numeric value.
  - `additional_prompts` object[]
    - `PROMPT_NAME` string — The prompt name should allow up to maximum 30 characters
    - `PROMPT_VALUE` string — The prompt value should allow up to maximum 30 characters
  - `vaultPaymentInfo` object
    - `vault_id` string — Vault customer profile id
    - `payment_id` string — Vault customer payment profile id
  - `po_number` string — The PO number must be provided to receive the Level 2 benefit.
  - `customer_VAT` string — Maximum 13-character alphanumeric value.
  - `freight_amount` number, double
  - `freight_tax_amount` number, double
  - `ship_from_postal_code` string — Maximum 10 numeric value
  - `VAT_invoice` string — Maximum 15-character alphanumeric value.
  - `duty_amount` number, double

## Response `200`

200

- object
  - `error_no` string
  - `error_code` string
  - `amount` string
  - `tax` string
  - `customfee` string
  - `msg` string
  - `desc` string
  - `additional_info` unknown
  - `approval_code` string
  - `rrn` string
  - `txnid` string
  - `tran_no` integer
  - `stan` integer
  - `is_partial_approve` integer
  - `partial_amount` string
  - `pan` string
  - `card_type` unknown
  - `phone_number` string
  - `email_id` string
  - `zip` unknown
  - `card_holder_name` string
  - `expiry_date` string
  - `address` string
  - `epi` string
  - `channel` string
  - `token` string
  - `card_brand` string

## Other responses

- `400` — 400

---

[API](https://skmtc.net/valorpaytech/apis/ecommerce-api.md) · [All operations](https://skmtc.net/valorpaytech/apis/ecommerce-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/valorpaytech/ecommerce-api/revisions/c6468b606325/schema)
